package com.study.model.pojo;

import java.io.Serializable;
import javax.persistence.*;


import java.math.BigDecimal;
import java.util.List;


/**
 * The persistent class for the orderdetails database table.
 * 
 */
@Entity
@Table(name="orderdetails")
@NamedQuery(name="Orderdetail.findAll", query="SELECT o FROM Orderdetail o")
public class Orderdetail implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@Column(name="o_id")
	private int oId;

	@Column(name="od_nonum")
	private int odNonum;

	@Column(name="od_num")
	private int odNum;

	@Column(name="od_price")
	private BigDecimal odPrice;

	@Column(name="od_state")
	private int odState;

	@Column(name="od_sumprice")
	private BigDecimal odSumprice;

	@Column(name="od_yesnum")
	private int odYesnum;

	//bi-directional many-to-one association to Deliverdetail
	@OneToMany(mappedBy="orderdetail1")
	private List<Deliverdetail> deliverdetails1;

	//bi-directional many-to-one association to Returnmore
	@OneToMany(mappedBy="orderdetail")
	private List<Returnmore> returnmores;

	//bi-directional many-to-one association to Good
	@ManyToOne
	@JoinColumn(name="goo_id")
	private Good good;

	//bi-directional one-to-one association to Orderform
	@OneToOne
	@JoinColumn(name="od_id")
	private Orderform orderform;

	public Orderdetail() {
	}

	public int getOId() {
		return this.oId;
	}

	public void setOId(int oId) {
		this.oId = oId;
	}

	public int getOdNonum() {
		return this.odNonum;
	}

	public void setOdNonum(int odNonum) {
		this.odNonum = odNonum;
	}

	public int getOdNum() {
		return this.odNum;
	}

	public void setOdNum(int odNum) {
		this.odNum = odNum;
	}

	public BigDecimal getOdPrice() {
		return this.odPrice;
	}

	public void setOdPrice(BigDecimal odPrice) {
		this.odPrice = odPrice;
	}

	public int getOdState() {
		return this.odState;
	}

	public void setOdState(int odState) {
		this.odState = odState;
	}

	public BigDecimal getOdSumprice() {
		return this.odSumprice;
	}

	public void setOdSumprice(BigDecimal odSumprice) {
		this.odSumprice = odSumprice;
	}

	public int getOdYesnum() {
		return this.odYesnum;
	}

	public void setOdYesnum(int odYesnum) {
		this.odYesnum = odYesnum;
	}

	public List<Deliverdetail> getDeliverdetails1() {
		return this.deliverdetails1;
	}

	public void setDeliverdetails1(List<Deliverdetail> deliverdetails1) {
		this.deliverdetails1 = deliverdetails1;
	}

	public Deliverdetail addDeliverdetails1(Deliverdetail deliverdetails1) {
		getDeliverdetails1().add(deliverdetails1);
		deliverdetails1.setOrderdetail1(this);

		return deliverdetails1;
	}

	public Deliverdetail removeDeliverdetails1(Deliverdetail deliverdetails1) {
		getDeliverdetails1().remove(deliverdetails1);
		deliverdetails1.setOrderdetail1(null);

		return deliverdetails1;
	}



	


	public Good getGood() {
		return this.good;
	}

	public void setGood(Good good) {
		this.good = good;
	}

	public Orderform getOrderform() {
		return this.orderform;
	}

	public void setOrderform(Orderform orderform) {
		this.orderform = orderform;
	}

	
	
	
	
	public List<Returnmore> getReturnmores() {
		return this.returnmores;
	}

	public void setReturnmores(List<Returnmore> returnmores) {
		this.returnmores = returnmores;
	}
	
	
	public Returnmore addReturnmore(Returnmore returnmore) {
		getReturnmores().add(returnmore);
		returnmore.setOrderdetail(this);

		return returnmore;
	}

	public Returnmore removeReturnmore(Returnmore returnmore) {
		getReturnmores().remove(returnmore);
		returnmore.setOrderdetail(null);

		return returnmore;
	}
	
}